package com.fh.controller;

import com.fh.common.ResultEnum;
import com.fh.common.ResultMessage;
import com.fh.model.TProduct;
import com.fh.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@CrossOrigin(origins = "*",maxAge = 3600)
@RestController
public class TProductController {
    @Autowired
    private ProductService productService;
    @RequestMapping("queryProduct")
    public ResultMessage queryProduct(){
        List<TProduct> productList =  productService.queryProduct();
        return new ResultMessage(ResultEnum.QUERY_SUCCESS,productList);
    }
}
